﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Web.Mvc;
using DB.SDFAuth;
using Nop.Admin;
using Nop.Services.Blogs;
using SDF.Core;
using SDFAuth.Models;

namespace SDFAuth.Web.Controllers.Account
{
    public class CityController : Controller
    {

        public IUserCityService UserCityService { get; set; }

        public ActionResult Index()
        {
            
            
            var cityItem = UserCityService.GetItem();
            var model = cityItem.ToModel();
            return View(model);    
            
        }

        [HttpPost]
        public ActionResult Index(CityModel model)
        {
            var userCity =new UserCity();
            userCity.ProvinceID = model.ProvinceID;
            userCity.CityID = model.CityID;
            userCity.DistrictID = model.DistrictID;
            userCity.UserId = model.UserID;
            userCity.id = model.Id;
            UserCityService.Update(userCity);

            return View(model);    
        }

       
   }
}
